<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width = device-width , initial-scale = 1 , minimum-scale = 1 , maximum-scale = 1 , user-scalable = no">
    <link rel="stylesheet" href="../../resource/css/bootstrap.min.css">
    <link rel="stylesheet" href="../../resource/css/common.css">
</head>
<body>
<div id="header" class="header-vh">载入中</div>
<div id="allmap"></div>

<script src="../../resource/js/jquery.min.js"></script>
<script src="../../resource/js/bootstrap.min.js"></script>
<script src="../../resource/js/commonjs.js"></script>
<script src="http://api.map.baidu.com/api?v=2.0&ak=qVrWQw9Vs8t7iPfG7bSj0137" type="text/javascript"></script>
<script type="text/javascript">
    $(function () {
        theLocation();
    })
    // 百度地图API功能
    // 用经纬度设置地图中心点
    function theLocation(){
        var map = new BMap.Map("allmap");
        map.centerAndZoom(new BMap.Point(116.331398,39.897445),16);
        map.enableScrollWheelZoom(true);
        var top_left_control = new BMap.ScaleControl({anchor: BMAP_ANCHOR_TOP_LEFT});// 左上角，添加比例尺
        var top_left_navigation = new BMap.NavigationControl();  //左上角，添加默认缩放平移控件
        var top_right_navigation = new BMap.NavigationControl({anchor: BMAP_ANCHOR_TOP_RIGHT, type: BMAP_NAVIGATION_CONTROL_SMALL});
        map.addControl(top_left_control);
        map.addControl(top_left_navigation);
        map.addControl(top_right_navigation);

        var lon = getArg("lon");
        var lat = getArg("lat");
        if(lon != "" && lat != ""){
            map.clearOverlays();
            var new_point = new BMap.Point(lon,lat);
            var marker = new BMap.Marker(new_point);  // 创建标注
            map.addOverlay(marker);              // 将标注添加到地图中
            map.panTo(new_point);
        }
        var name = decodeURIComponent(getArg("name"));
        $("#header").html('<a href="javascript:void(0)" class="nav-back">返回</a>'+ name + '<span class="register-title"></span>');
        $(".nav-back").click(function () {
            history.go(-1);
        })
    }
</script>
</body>
</html>